package com.kyxx.mycommonproject.wuliugenzong;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.kyxx.mycommonproject.R;
import com.kyxx.mycommonproject.base.BaseActivity0;
import com.kyxx.mycommonproject.widget.ListViewForScrollView;

public class DeliverTrackActivity extends BaseActivity0 {
    private ImageView iv_good;
    private TextView tv_status;
    private TextView tv_com;
    private TextView tv_no;
    private TextView tv_phone;
    private ImageView iv_deliver;
    private TextView tv_deliver;
    private RelativeLayout rl_deliver;
    private ListViewForScrollView lvfs_deliver;

    @Override
    protected void loadViewLayout() {
        setContentView(R.layout.activity_deliver_track);
    }

    @Override
    protected void findViewById() {
        iv_good = (ImageView) findViewById(R.id.iv_good);
        tv_status = (TextView) findViewById(R.id.tv_status);
        tv_com = (TextView) findViewById(R.id.tv_com);
        tv_no = (TextView) findViewById(R.id.tv_no);
        tv_phone = (TextView) findViewById(R.id.tv_phone);
        iv_deliver = (ImageView) findViewById(R.id.iv_deliver);
        tv_deliver = (TextView) findViewById(R.id.tv_deliver);
        rl_deliver = (RelativeLayout) findViewById(R.id.rl_deliver);
        lvfs_deliver = (ListViewForScrollView) findViewById(R.id.lvfs_deliver);
        lvfs_deliver.setFocusable(false);
    }

    @Override
    protected void setListener() {
        tv_phone.setOnClickListener(onClickListener);
    }

    @Override
    protected void processLogic() {
        loadToolBar("物流跟踪");
        DeliverTrackAdapter deliverTrackAdapter = new DeliverTrackAdapter();
        lvfs_deliver.setAdapter(deliverTrackAdapter);
    }

    View.OnClickListener onClickListener = new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            switch (view.getId()) {
                case R.id.tv_phone:
                    break;
            }
        }
    };

    private class DeliverTrackAdapter extends BaseAdapter {
        @Override
        public int getCount() {
            return 10;
        }

        @Override
        public Object getItem(int i) {
            return null;
        }

        @Override
        public long getItemId(int i) {
            return 0;
        }

        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            ViewHolder holder;
            if (view == null) {
                holder = new ViewHolder();
                view = View.inflate(context, R.layout.item_deliver_track, null);
                holder.tv_location = (TextView) view.findViewById(R.id.tv_location);
                holder.tv_time = (TextView) view.findViewById(R.id.tv_time);
                holder.iv_point = (ImageView) view.findViewById(R.id.iv_point);
                view.setTag(holder);
            } else {
                holder = (ViewHolder) view.getTag();
            }
            return view;
        }
    }

    public static class ViewHolder {
        TextView tv_location;
        TextView tv_time;
        ImageView iv_point;
    }
}
